<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        (function () {
            function invoke(f,start,interval,end) {
                if(!start) start=0;
                if(arguments.length <=2){
                    setTimeout(f,start);
                }else{
                    setTimeout(repeat,start);
                    function repeat() {
                        var h=setInterval(f,interval);
                        if(end) setTimeout(function () {
                            clearInterval(h);
                        },end);
                    }
                }
            };
            invoke(function(){console.log(12),11,500,222});

            console.log(window.location ===document.location);
            var firstpara=document.getElementsByTagName("p")[0];
        })();
    </script>
</head>
<body>

</body>
</html>